import request from "@/utils/request.js"
/* 
	登录接口
*/
export function login(params) {
	return request.post({
		url: '/user/login',
		params
	})
}
/* 
	注册接口
*/
export function register(params) {
	return request.post({
		url: '/user/register',
		params
	})
}
/* 
	验证码
*/
export function yzmCode(params) {
	return request.post({
		url: '/questions/sendcode',
		params
	})
}
/* 
	修改密码
*/
export function editPassword(params) {
	return request.post({
		url: '/questions/replacepassword',
		params
	})
}
/* 
	获取题目分组
*/
export function subjectType(params) {
	return request.get({
		url: '/questions/category',
		params
	})
}
/* 
	顺序练习
*/
export function orderPractice(params) {
	return request.get({
		url: '/questions/sort',
		params
	})
}
/* 
	获取教练信息
*/
export function coachInfo(params) {
	return request.get({
		url: '/sp/getByCode',
		params
	})
}
/* 
	提交信息
*/
export function addInvitation(params) {
	return request.post({
		url: '/sp/add',
		params
	})
}
/* 
/* 
	随机练习
*/
export function random(params) {
	return request.get({
		url: '/questions/random',
		params
	})
}

/* 
	答题
*/
export function answerApi(params) {
	return request.post({
		url: '/questions/submit',
		params
	})
}

/* 
 顺序练习下一题
*/
export function nextSubjectApi(params) {
	return request.get({
		url: '/questions/next',
		params
	})
}
/* 
 随机练习下一题
*/
export function randomNext(params) {
	return request.get({
		url: '/questions/random_next',
		params
	})
}
/* 
 顺序练习上一提
*/
export function prevSubjectApi(params) {
	return request.get({
		url: '/questions/last',
		params
	})
}
/* 
 随机练习上一题
*/
export function randomPrev(params) {
	return request.get({
		url: '/questions/random_last',
		params
	})
}
/* 
 错题记录
*/
export function errorRecord(params) {
	return request.get({
		url: '/questions/error_record',
		params
	})
}
/* 
 模拟考试试卷
*/
export function mockexam(params) {
	return request.get({
		url: '/questions/exam',
		params
	})
}
//交卷
export function submitExam(params) {
	return request.post({
		url: '/questions/submitexam',
		params
	})
}
//清空错误题目
export function emptyErrSubject(params) {
	return request.post({
		url: '/questions/deleteerrors',
		params
	})
}
//清空VIP错误题目
export function emptyErrVipSubject(params) {
	return request.post({
		url: '/questions/deletevips',
		params
	})
}

//顺序练习 对错数量
export function rightOrError(params) {
	return request.get({
		url: '/questions/answernumber',
		params
	})
}


//删除顺序练习记录重新开始的时候用
export function deleteRecord(params) {
	return request.post({
		url: '/questions/deletesort',
		params
	})
}

//VIP顺序练习分类
export function vipClassify(params) {
	return request.post({
		url: '/questions/vipcategory',
		params
	})
}

//获取正确率
export function rightRate(params) {
	return request.get({
		url: '/questions/rate',
		params
	})
}

//获取分享key
export function shareKey(params) {
	return request.get({
		url: '/questions/getmyukey',
		params
	})
}

//获取个人信息
export function userinfo(params) {
	return request.get({
		url: '/user/index',
		params
	})
}

//购买
export function buyVip(params) {
	return request.get({
		url: '/questions/openvip',
		params
	})
}


//我的客户
export function myCustomer(params) {
	return request.get({
		url: '/questions/mycustom',
		params
	})
}
//个人中心余额
export function myAmount(params) {
	return request.get({
		url: '/questions/income',
		params
	})
}

//会员列表
export function vipList(params) {
	return request.get({
		url: '/questions/product_list',
		params
	})
}
//提交订单
export function confirmOrder(params) {
	return request.post({
		url: '/questions/submitOrder',
		params
	})
}
// 上传图片
export function upload(data) {
	return request.post({
		url: '/questions/uploadfile',
		data,
		headers: {
			'Content-Type': 'multipart/form-data',
			'clientType': 'web'
		}
	})
}
//申请提现
export function applyWith(params) {
	return request.post({
		url: '/questions/getcash',
		params
	})
}
//收益明细
export function profitDetail(params) {
	return request.get({
		url: '/questions/money_log',
		params
	})
}
//提现记录
export function withdrawalRecord(params) {
	return request.get({
		url: '/questions/get_cash_log',
		params
	})
}

//月度账单
export function monthRecord(params) {
	return request.get({
		url: '/questions/money_log_month',
		params
	})
}

//修改个人信息
export function editUserInfo(params) {
	return request.post({
		url: '/user/profile',
		params
	})
}

//是否支付
export function payStatus(params) {
	return request.get({
		url: '/questions/orderinfo',
		params
	})
}
//根据排序获取题目
export function sortSubject(params) {
	return request.get({
		url: '/questions/getbysort',
		params
	})
}

//兑换会员
export function exchangeVip(params) {
	return request.post({
		url: '/user/exchange',
		params
	})
}
//学员列表
export function studenListApi(params, promotion) {
	return request.get({
		url: '/sp/spUsers',
		params
	})
}
//客户列表
export function customerListApi(params, promotion) {
	return request.get({
		url: '/sp/orgs',
		params
	})
}
//模拟登陆
export function simulationLogin(params) {
	return request.post({
		url: '/sp/verifyCode',
		params
	})
}
//提交已经打过电话的接口
export function callPhoneConfirm(params) {
	return request.post({
		url: '/sp/contact',
		params
	})
}